<%@ page language="java" import="dao.*" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*" %>
<%@page import="util.*" %>


<%
%>
<% HashMap map = Query.make("shangpinxinxi").where("id", request.getParameter("id")).find(); %>
<%@ include file="head.jsp" %>
<%@ include file="header.jsp" %>
<link rel="stylesheet" href="js/swiper/swiper.css">
<script src="js/swiper/swiper.js"></script>
<script src="js/jquery.validate.js"></script>
<script src="js/datepicker/WdatePicker.js"></script>


<div class="" style="">

    <div class="container"><!-- 使用bootstrap css框架，container定宽，并剧中 https://v3.bootcss.com/css/#overview-container -->
        <div class="row">
            <div class="col-sm-12 col-md-12">
                <div class="title-modelbox-widget">
                    <h3 class="section-title">
                        商品详情 </h3>
                    <div class="sidebar-widget-body">


                        <div class="">
                            <div class="goods-info clearfix">
                                <div class="gallery-list">
                                    <div class="swiper-container gallery-top" id="shangpin-galler">
                                        <div class="swiper-wrapper">
                                        </div>
                                    </div>
                                    <div class="swiper-container gallery-thumbs" id="shangpin-thumb">
                                        <div class="swiper-wrapper">
                                        </div>
                                    </div>
                                </div>
                                <div class="goods-right-content">
                                    <h3 class="title"><%= map.get("shangpinmingcheng") %>
                                    </h3>
                                    <div class="descount">
                                        <div>
                        <span class="name">
                            商品分类：
                        </span>
                                            <span class="val">
                            <%
                                HashMap mapshangpinfenlei7 = new CommDAO().find("SELECT fenleimingcheng FROM shangpinfenlei where id='" + map.get("shangpinfenlei") + "'");
                            %><%= mapshangpinfenlei7.get("fenleimingcheng") %>                        </span>
                                        </div>
                                        <div>
                        <span class="name">
                            售价：
                        </span>
                                            <span class="val">
                            <%= map.get("shoujia") %>                        </span>
                                        </div>


                                    </div>

                                    <% HashMap readMap = Query.make("shangpinxinxi").where("id", request.getParameter("id")).find(); %>
                                    <form class="form-inline" action="xiadan.jsp?a=insert" id="form1" method="post">
                                        <!-- form 标签开始 -->
                                        <div style="display: none">
                                            <input type="hidden" name="iszf" value="否"/><input type="hidden"
                                                                                               id="shangpinbianhao"
                                                                                               name="shangpinbianhao"
                                                                                               value="<%= Info.html(map.get("shangpinbianhao")) %>"/><input
                                                type="hidden" id="shangpinmingcheng" name="shangpinmingcheng"
                                                value="<%= Info.html(map.get("shangpinmingcheng")) %>"/><input
                                                type="hidden" id="shoujia" name="shoujia"
                                                value="<%= Info.html(map.get("shoujia")) %>"/><input type="hidden"
                                                                                                     id="shangpinfenlei"
                                                                                                     name="shangpinfenlei"
                                                                                                     value="<%= Info.html(map.get("shangpinfenlei")) %>"/><input
                                                type="hidden" id="faburen" name="faburen"
                                                value="<%= Info.html(map.get("faburen")) %>"/><input type="text"
                                                                                                     class="form-control"
                                                                                                     style="width:150px;"
                                                                                                     readonly="readonly"
                                                                                                     id="xiadanren"
                                                                                                     name="xiadanren"
                                                                                                     value="<%= request.getSession().getAttribute("username") !=null ? request.getSession().getAttribute("username") : "" %>"/><input
                                                type="hidden" name="shangpinxinxiid"
                                                value="<%= map.get("id") %>"/><input name="referer" id="referer"
                                                                                     value="" type="hidden"/>
                                            <script>
                                                $('#referer').val(location.href);
                                            </script>
                                            <input type="hidden" name="jiaoyizhuangtai" id="jiaoyizhuangtai"
                                                   value="待交易"/></div>

                                        <div class="mt10">
                                            <div class="spec-list">
                                            </div>


                                            <div class="mt10">

                                                <% if (Query.make("xiadan").where("shangpinxinxiid", map.get("id")).count() == 0) { %>
                                                <a class="btn btn-primary" href="xiadanadd.jsp?id=<%= map.get("id") %>">立即下单</a>
                                                <%}%>


                                            </div>
                                        </div>
                                        <!--form标签结束--></form>
                                    <script>
                                        $(function () {
                                            $('#form1').validate();
                                        })
                                    </script>
                                </div>
                            </div>
                            <div class="goods-content">
                                <%= map.get("miaoshu") %>
                            </div>

                            <script>
                                (function () {
                                    var images = "<%= map.get("shangpintupian") %>".split(",");
                                    if (images.length > 0) {
                                        for (var i = 0; i < images.length; i++) {
                                            var path = images[i]
                                            var src = '<div class="swiper-slide"><div class="img-box pb100"><div class="img" style="background-image: url(' + path + ')"></div></div></div>';
                                            $('#shangpin-galler .swiper-wrapper').append(src);
                                            $('#shangpin-thumb .swiper-wrapper').append(src);
                                        }

                                        var thumbsSwiper = new Swiper('#shangpin-thumb', {
                                            spaceBetween: 10,
                                            slidesPerView: 4,
                                            watchSlidesVisibility: true,//防止不可点击
                                        })
                                        var gallerySwiper = new Swiper('#shangpin-galler', {
                                            spaceBetween: 10,
                                            thumbs: {
                                                swiper: thumbsSwiper,
                                            }
                                        })
                                    }

                                })();

                            </script>
                        </div>


                    </div>
                    <!-- /.sidebar-widget-body -->
                </div>


            </div>
        </div><!-- container定宽，并剧中结束 --></div>
</div>
<%@ include file="footer.jsp" %>
<%@ include file="foot.jsp" %>